package com.newsmanagement.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SlauFarmBatchMapper {

    // 查询所有养殖企业进场编号（batch_id）
    @Select("SELECT batch_id, farm_id FROM farm_batch")
    List<Map<String, Object>> selectFarmBatchList();

    // 根据进场编号（batch_id）查询产品品种
    @Select("SELECT type FROM farm_batch WHERE batch_id = #{batchId}")
    String selectProductTypeByBatchId(@Param("batchId") String batchId);
}